Page({
  data: {
    Height: 0,
    scale: 15,
    latitude: "",
    longitude: "",
    markers: [],
    circles: []
  },

  onLoad: function () {
    wx.getSystemInfo({
      success: (res) => {
        //设置map高度，根据当前设备宽高满屏显示
        this.setData({
          view: {
            Height: res.windowHeight
          }
        })
      }
    })

    wx.getLocation({
      type: 'wgs84', // 默认为 wgs84 返回 gps 坐标，gcj02 返回可用于 wx.openLocation 的坐标
      success: (res) => {
        res.latitude = 30.888444464788034
        res.longitude = 103.59656354183198
        this.setData({
          latitude: res.latitude,
          longitude: res.longitude,
          markers: [{
            id: "1",
            latitude: res.latitude,
            longitude: res.longitude,
            width: 30,
            height: 30,
            iconPath: "/assests/imgs/my.png",
            title: "成都东软学院"
          }],
          circles: [{
            latitude: res.latitude,
            longitude: res.longitude,
            color: '#FF0000DD',
            fillColor: '#7cb5ec88',
            radius: 500,
            strokeWidth: 1
          }]
        })
      }
    })
  },

  regionchange(e) {
    console.log("regionchange===" + e.type)
  },

  //点击merkers
  markertap(e) {
    console.log(e)
    wx.navigateTo({
      url: '../weather/weather',
    })
  },
})